Repository navigation
fix(gateway): 补修 #473/#474 合入后仍在的问题 - #486
Merged
Merged
Conversation
…eat headers Reject decompressed bodies that exceed the inflated size limit instead of silently truncating them. Keep /v1/messages body-decoding errors in the Anthropic envelope. Send account/provider headers with an early heartbeat commit, and record a disconnect during that wait as canceled rather than a normal stream open. Correct the changelog wording that said heartbeat avoids a slow upload.
… cap Restore the shipped v0.7.28 changelog wording; the correction already lives in the unreleased fragment. Cover a decompressed body that fills the inflate cap exactly when read in small chunks, and note that a client disconnect during the heartbeat wait does not bind the session.
Pick up the failover, check-in, and WorkBuddy changes that landed after this branch. chat.go auto-merged; the stream route hint calls stay in place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the pre-merge review notes on #473 and #474, which landed on main (and shipped in v0.7.28 / v0.7.29) without these patches. This PR does not revert either feature.
#474 gzip / error shape
ErrInflatedBodyTooLarge(mapped to 413request body too large) instead ofio.LimitReader's silent EOF. A JSON decoder therefore sees "body too large", not a syntax error from a truncated object, and cannot continue with a cut-off body.POST /v1/messagesbody-decoding failures (unsupported encoding, corrupt gzip, over-limit inflate) use the Anthropic error envelope this endpoint already returns for other request errors, not the OpenAI shape fromwriteRequestBodyError.#473 heartbeat / headers / metrics / changelog
StreamRouteHinton the request context letssetStreamHeadersincludeX-Qoder-Account,X-CLI2API-Account, andX-CLI2API-Providerbefore the heartbeat'sWriteHeader. Holding the heartbeat untilChatStreamProxyreturns would defeat its purpose.Adopt(), a heartbeat write failure (clientGone()) or a canceled request context is recorded ascanceled. The handler no longer writesstreamingfirst and does not treat a disconnect during the heartbeat wait as a normal stream open.Tests
/v1/messagesunknown encoding and corrupt gzip keep the Anthropic error shape.streaming.Does not merge, release, or deploy.